package com.ltxtiyu.video.api;

import com.alibaba.dubbo.config.annotation.Reference;
import com.ltxtiyu.video.service.app.UserService;
import com.ltxtiyu.video.tool.ParamTool;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("/apiUser")
public class ApiUser {
    @Reference
    UserService userService;

    @RequestMapping("/userIndex")
    public String userIndex(HttpServletRequest request){
        Map<String, String> map = ParamTool.requestToParamMap(request);
        map.put("userId",String.valueOf(-1));       // -1表示用户未登录
        return  userService.userIndex(map);
    }
}
